<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>转账</title>
    <link rel="stylesheet" href="/static/style.css">
    <style>
        .container { max-width: 500px; margin: 40px auto; background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(45,140,240,0.10); padding: 30px 40px; }
        h2 { color: #2d8cf0; margin-bottom: 20px; text-align: center; }
        form { display: flex; flex-direction: column; }
        label { margin-bottom: 6px; color: #333; font-weight: bold; }
        select, input[type="text"], input[type="number"] { padding: 10px; margin-bottom: 18px; border: 1px solid #d0d0d0; border-radius: 5px; font-size: 15px; }
        button { background: #2d8cf0; color: #fff; border: none; padding: 12px; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold; margin-bottom: 10px; }
        button:hover { background: #1a6fb3; }
        .back-link { background: #f56c6c; text-align: center; text-decoration: none; display: block; }
        .back-link:hover { background: #c0392b; }
        .msg { padding: 10px; margin-bottom: 18px; border-radius: 5px; text-align: center; }
        .msg.success { background: #f0f9ff; color: #2d8cf0; border: 1px solid #2d8cf0; }
        .msg.error { background: #fef0f0; color: #f56c6c; border: 1px solid #f56c6c; }
        .card-info { background: #f7fafd; padding: 10px; margin-bottom: 18px; border-radius: 5px; border-left: 4px solid #2d8cf0; }
    </style>
</head>
<body>
    <div class="container">
        <h2>转账</h2>
        {% if msg %}
        <div class="msg {% if '成功' in msg %}success{% else %}error{% endif %}">{{ msg }}</div>
        {% endif %}
        
        <form method="post">
            <label>转出银行卡：</label>
            <select name="from_card_id" required>
                <option value="">请选择转出卡</option>
                {% for card in cards %}
                <option value="{{ card.cardID }}" {% if request.form.get('from_card_id') == card.cardID %}selected{% endif %}>
                    {{ card.cardID }} (余额: {{ card.balance }})
                </option>
                {% endfor %}
            </select>
            
            <label>转入卡号：</label>
            <input type="text" name="to_cardID" placeholder="请输入转入卡号" value="{{ request.form.get('to_cardID', '') }}" required>
            
            <label>转账金额：</label>
            <input type="number" name="amount" step="0.01" min="0.01" placeholder="请输入转账金额" value="{{ request.form.get('amount', '') }}" required>
            
            <button type="submit">确认转账</button>
            <a href="/customer/dashboard" class="back-link">返回客户首页</a>
        </form>
        
        {% if cards %}
        <div class="card-info">
            <strong>您的银行卡：</strong><br>
            {% for card in cards %}
            • {{ card.cardID }} - 余额: {{ card.balance }} 元<br>
            {% endfor %}
        </div>
        {% endif %}
    </div>
</body>
</html> 